/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.Arrays;

/**
 * <p>Project: javaseapp - Array1
 * <p>Powered by webrx On 2021-08-20 11:18:26
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Array1 {
    public static void main(String[] args) {
        int[] nums = new int[]{1, 0, 5, 2, 10, 8, 7, 2, 99, 18};
        System.out.println(Arrays.toString(nums));
        Arrays.sort(nums);//升序
        System.out.println(Arrays.toString(nums));

        Integer[] nums2 = new Integer[]{1, 0, 5, 2, 10, 8, 7, 2, 99, 18};
        System.out.println(Arrays.toString(nums2));
        Arrays.sort(nums2);//升序
        System.out.println(Arrays.toString(nums2));
        Arrays.sort(nums2, (a, b) -> b - a);//降序
        System.out.println(Arrays.toString(nums2));

    }
}
